#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
//class TrafficTool
//{
//public:
//	virtual void transports() = 0;
//};
//class Bus : public  TrafficTool
//{
//public:
//	void transports()override
//	{
//		cout << "Bus" << endl;
//	}
//};
//class Bus : public  TrafficTool
//{
//public:
//	void transports()override
//	{
//		cout << " Bike" << endl;
//	}
//};
//class cooker
//{
//public:
//	virtual void buyFood() = 0;
//	virtual void cook() = 0;
//	virtual void eat() = 0;
//};
//class Maid
//{
//public:
//	virtual void cook() = 0;
//	virtual void wash() = 0;
//	virtual void clean() = 0;
//};
//class Person :public cooker, public Maid
//{
//public:
//	void buyFood()override
//	{
//		cout << "buyFood" << endl;
//	}
//	void cook()override
//	{
//		cout << "cook" << endl;
//	}
//	void eat()override
//	{
//		cout << "eat" << endl;
//	}
//	void wash()override
//	{
//		cout << "wash" << endl;
//	}
//	void clean()override
//	{
//		cout << "clean" << endl;
//	}
//};
//class AirTransportation
//{
//public:
//	virtual void sendPackageOnAir() = 0;
//};
//class LandTransportation
//{
//public:
//	virtual void sendPackageOnLand() = 0;
//};
//class SF :public AirTransportation, public LandTransportation
//{
//public:
//	void sendPackageOnAir()override
//	{
//		cout << "SF Air" << endl;
//	}
//	void sendPackageOnLand()override
//	{
//		cout << "SF Land" << endl;
//	}
//};
//class SF :public AirTransportation, public LandTransportation
//{
//public:
//	void sendPackageOnAir()override
//	{
//		cout << "SF Air" << endl;
//	}
//	void sendPackageOnLand()override
//	{
//		cout << "SF Land" << endl;
//	}
//};
//void sendLand(LandTransportation& expressCompany)
//{
//	expressCompany.sendPackageOnLand();
//}
//void sendAir(AirTransportation& expressCompany)
//{
//	expressCompany.sendPackageOnAir();
//}
//class Animal
//{
//public:
//	virtual ~Animal()
//	{
//		cout << 1 << endl;
//	}
//};
//class Person:public Animal
//{
//public:
//	int* n;
//	Person()
//	{
//		n = new int(10);
//	}
//	~Person()override
//	{
//		cout << 2 << endl;
//		if (n != nullptr)
//		{
//			delete n;
//			n = nullptr;
//		}
//	}
//};
//struct Student
//{
//	string name;
//	int age;
//	int score;
//	Student()
//	{
//		name = "";
//		age = 0;
//		score = 0;
//	}
//	Student(string name, int age, int score) :name(name), age(age), score(score) {};
//	void study()
//	{
//		cout << "study" << endl;
//	}
//	~Student()
//	{
//		cout << "Student" << endl;
//	}
//};
template<typename T, typename M = int >
void add(T n1, M n2)
{
	cout << n1 + n2 << endl;
}
template<typename T>
void swap(T& n1, T& n2)
{
	T temp = n1;
	n1 = n2;
	n2 = temp;
}
template<typename R,typename T1,typename T2>
R caculate(T1 x, T2 y)
{
	return (R)(x + y);
}
int main()
{/*
	Person xiaoming;
	xiaoming.buyFood();
	SF sf;
	sendLand(sf); 
	Animal* animal = new Person();
	delete animal;
	struct Student xiaobai;
	struct Student xioahei = Student();
	struct Student xiaohei = Student("xiaobai", 18, 99);
	struct Student* xiaohong = new Student();
	xiaobai.name = "xiaobai";
	xiaohei.age = 10;
	xiaohong->age = 11;
	delete xiaohong;*/
	/*add<int, double>(10, 3.14);
	add(10, 3.14);
	int x = 10;
	int y = 20;
	swap(x, y);*/
	add<int>(10, 3.14);
	int res = caculate<int>(1.2,3.4);
	cout << res << endl;
	return 0;
}